﻿using System;

namespace Microsoft.Coding4Fun.TweetCraft.Wow
{
    /// <summary>
    /// Detects World of Warcraft installation and returns related information.
    /// </summary>
    public interface IWorldOfWarcraft
    {
        /// <summary>
        /// Gets a value indicating whether a World of Warcraft installation is detected.
        /// </summary>
        bool IsDetected { get; }

        /// <summary>
        /// Gets a value indicating whether World of Warcraft is running.
        /// </summary>
        bool IsRunning { get; }

        /// <summary>
        /// Returns the install path of World of Warcraft.
        /// </summary>
        /// <returns>A <see cref="string"/> containing the World of Warcraft installation path.</returns>
        string InstallPath { get; }

        /// <summary>
        /// Gets a value indicating whether World of Warcraft accounts are available through <see cref="GetAccountNames"/>.
        /// </summary>
        bool AreAccountsAvailable { get; }

        /// <summary>
        /// Returns an array of the account names in World of Warcraft.
        /// </summary>
        /// <returns>An array of <see cref="string"/>s that contain the account names.</returns>
        string[] GetAccountNames();

        /// <summary>
        /// Returns an array of the addon names in World of Warcraft.
        /// </summary>
        /// <returns>An array of <see cref="string"/>s that contain the addon names.</returns>
        string[] GetAddOnNames();

        /// <summary>
        /// Returns an array of the realm names of an account.
        /// </summary>
        /// <param name="accountName">The name of the account.</param>
        /// <returns>An array of <see cref="string"/>s that contain the realm names.</returns>
        string[] GetRealmNames(string accountName);

        /// <summary>
        /// Returns an array of an account's character names in a realm.
        /// </summary>
        /// <param name="accountName">The name of the account.</param>
        /// <param name="realmName">The name of the realm.</param>
        /// <returns>An array of <see cref="string"/>s that contain the character names.</returns>
        string[] GetCharacterNames(string accountName, string realmName);

        /// <summary>
        /// Returns the path to the addon.
        /// </summary>
        /// <param name="addOnName">The name of the addon.</param>
        /// <returns>A <see cref="string"/> containing the path to the addon.</returns>
        string GetAddOnPath(string addOnName);

        /// <summary>
        /// Returns the path to the SavedVariables file for an account and addon.
        /// </summary>
        /// <param name="accountName">The name of the account.</param>
        /// <param name="addOnName">The name of the addon.</param>
        /// <returns>A <see cref="string"/> containing the path to the SavedVariables file.</returns>
        string GetSavedVariablesPath(string accountName, string addOnName);

        /// <summary>
        /// Returns the path to the SavedVariablesPerCharacter file for a character and addon.
        /// </summary>
        /// <param name="accountName">The name of the account.</param>
        /// <param name="realmName">The name of the realm.</param>
        /// <param name="characterName">The name of the character.</param>
        /// <param name="addOnName">The name of the addon.</param>
        /// <returns>A <see cref="string"/> containing the path to the SavedVariablesPerCharacter file.</returns>
        string GetSavedVariablesPerCharacterPath(string accountName, string realmName, string characterName, string addOnName);

        /// <summary>
        /// Returns a value indicating whether an addon with the name is installed.
        /// </summary>
        /// <param name="addOnName">The name of the addon.</param>
        /// <returns>True, if the addon is installed; False otherwise.</returns>
        bool IsAddOnInstalled(string addOnName);

        /// <summary>
        /// Returns the version of the addon.
        /// </summary>
        /// <param name="addOnName">The name of the addon.</param>
        /// <returns>An instance of the <see cref="Version"/> class containing the version of the addon.</returns>
        Version GetAddOnVersion(string addOnName);

        /// <summary>
        /// Starts up World of Warcraft.
        /// </summary>
        void Start();
    }
}